1. Field of the Invention
The present invention relates to an image processing method and apparatus, and more particularly to an image processing method and apparatus for quantizing frequency conversion data and coding the quantized conversion data.
2. Related Background Art
A number of color image compressing techniques have been proposed in the past. As a typical one of color still image coding techniques, there is proposed an adaptive discrete cosine transform coding method (hereinafter referred to as an ADCT method).
FIG. 3 is a conceptual view showing arrangement of an image coding apparatus using the ADCT method. It is assumed that an input image is given by data converted into 8 bits, i.e., 256 gradations, for each color in a not-shown analog-to-digital converter (hereinafter referred to as an A/D converter) and the number of colors is three, i.e., luminance Y, color P.sub.B and color P.sub.R, in this case.
The digital data of the luminance signal Y inputted through an input terminal 101 in FIG. 3 is subjected to two-dimensional discrete cosine transform (hereinafter abbreviated as DCT) in an N.times.N DCT circuit 102 in units of subblocks each comprising N.times.N pixels. Thereafter, the conversion coefficients are linearly quantized in a linear quantizer 113 with a quantizing step size being different for each of the conversion coefficients. The quantizing step sizes for respective conversion coefficients are given by values resulted from multiplying 2.sup.S by quantization matrix elements of N.times.N in consideration of the fact that visual sensitivity for quantizing noise is different for each of the conversion coefficients. Here, S is 0 or a positive or negative integer and called a scaling factor. The image quality or the data to be generated is controlled depending on the value of S.
One example of the quantization matrix elements is shown in FIG. 5 in the case of 8.times.8. A quantization matrix generation circuit 111 is controlled by a control circuit 302 and generates a quantization matrix for the luminance signal Y. A switch 114 is changed over to select the side a for supplying the quantization matrix for the luminance signal Y to a multiplier 110. Using the scaling factor S supplied from a scaling factor generation circuit 301, the multiplier 110 multiplies 2.sup.S by each quantized element of the quantization matrix. The multiplied results are supplied to the linear quantizer 103 where the conversion coefficients are linearly quantized by using the supplied results.
After the quantization, direct current conversion coefficients (hereinafter referred to as DC components) are supplied to a one-dimensional predictor 104 to calculate prediction values using several subblocks adjacent to each other, and prediction errors are subjected to Huffman coding in a Huffman encoder 105. More specifically, after dividing quantized outputs of the prediction errors into groups, the ID numbers of the groups to which the respective prediction errors belong are first subjected to Huffman coding, and which values in each group correspond to the respective prediction errors are then represented by using equi-length codes.
The conversion coefficients other than the above DC components, i.e., the alternating current conversion coefficients (hereinafter referred to as AC components), are supplied to a zigzag scan circuit 106 in which the AC components are scanned in a zigzag manner with two-dimensional frequencies from low-frequency component to high-frequency component as shown in FIG. 4, followed by Huffman coding in a Huffman encoder 107. More specifically, those conversion coefficients for which the quantized outputs are not 0 (hereinafter referred to as significant coefficients) are divided into groups depending on their values. The ID numbers of the divided groups and the numbers of those conversion coefficients which are present between every two significant coefficients and for which the quantized outputs are 0 (hereinafter referred to as insignificant coefficients) are subjected in pair to Huffman coding. Subsequently, which values in each group correspond to the significant coefficients are represented by using equi-length codes.
Respective code strings of the DC components and the AC components are multiplexed in a multiplexer 108 and outputted from an output terminal 109.
Next, when the digital data of the chrominance signals P.sub.B, P.sub.R are inputted through the input terminal 101, the control circuit 302 controls the quantization matrix generation circuit 111 to generate quantization matrices for the chrominance signals P.sub.B, P.sub.R. The switch 114 is changed over to select the side b for supplying the quantization matrices for the chrominance signals to the multiplier 110. Subsequently, the chrominance signals processed in a like manner to the luminance signal Y as mentioned above for Huffman coding.
When the compression rate requires to be increased (for a higher degree of compression) from limitations in a transmission path or other reasons, control information is entered from a input terminal 303 so that the control circuit 302 controls a scaling factor generation circuit 301 to increase the scaling factor S. Conversely, in order to obtain a high-quality image, the scaling factor S is made smaller.
However, because the scaling factor S of the same value is used when coding the luminance signal Y and the chrominance signals P.sub.B P.sub.R in the above prior art, there has accompanied a shortcoming that image quality in color areas (particularly in a red area to which human eyes are more sensitive) deteriorates to a remarkable extent, when the value of the scaling factor S is increased to obtain a high degree of compression.